import { getUserDepID, getCompanyID, getUserID } from '@/utils';

/** 验收入库Manage数据范围权限判断 */
export const ApplyManageTab = (curRes: Record<string, any>) => {
  if (curRes?.['/assetApplyStorage/createCompanyID']) {
    return {
      createCompanyID: getCompanyID(),
      params: 'createCompanyID',
    };
  } else if (curRes?.['/assetApplyStorage/createDepartmentID']) {
    return {
      createDepartmentID: getUserDepID(),
      params: 'createDepartmentID',
    };
  } else if (curRes?.['/assetApplyStorage/createrID']) {
    return {
      createrID: getUserID(),
      params: 'createrID',
    };
  } else {
    return {};
  }
};

export const AssetMaterialManage = (curRes: Record<string, any>) => {
  // if (curRes?.['/assetMaterial/createCompanyID']) {
  //   return {
  //     createCompanyID: getCompanyID(),
  //     params: 'createCompanyID',
  //   };
  // } else {
  //   return {};
  // }

  if (curRes?.['/assetMaterial/assetCompanyID']) {
    return {
      assetCompanyID: getCompanyID(),
      params: 'assetCompanyID',
    };
  } else {
    return {};
  }
};
